function scrollLoad(askFun){
	$(window).scroll(function(){
		if($('.loadTag').length>0){
			var top=$('.loadTag').position().top-600;
			var loaded = true;
			if($(window).scrollTop() + $(window).height() > top ){
				if(askFun){
					askFun();
				}else{
					$(".myNav .cur").trigger("onLoadAsk");
				}
				$('.loadTag').remove();
			}
		}
	});
}
function viewUserInfo(){
	var ownerInfo,timer;
	$(".stream-reason-avatar dt").hover(function(){
		ownerInfo=$(this).find('.ownerInfo');
		var myId=$("#myId").attr("value");
		var userName=ownerInfo.find("p em").html();
		var url="../userAjax/getUserInfo.action";
		var params={"query.nickname":userName};
		doAjax(url,params,function(ajaxResult){
			if(ajaxResult.OK){
				var follow=ajaxResult.resultMap.userInfo.follow;
				var currentUserId=ajaxResult.resultMap.userInfo.id;
				if(currentUserId!=myId){
					ownerInfo.show();
					if(follow){
						ownerInfo.find(".follow").addClass('following').text('取消关注');
					}
				}
			}
		});
		ownerInfo.find(".follow").click(function(){
			if($(this).hasClass("following")){
				var user =  $(this);
				var params = {
						"query.followId" : user.parents(".stream-one").attr("userId")
				};
				unFollowUser(params, function(ajaxResult) {
							if (ajaxResult.OK) {
								user.removeClass("following").text("关注");
								user.unbind().click(regMyFollow);
							}
						})
			}
			else{
				var user = $(this);
				var params = {
					"query.followId" : user.parents(".stream-one").attr("userId")
				};
				followUser(params, function(ajaxResult) {
							if (ajaxResult.OK) {
								user.addClass("following").text("取消关注");
								user.unbind().click(regMyUnFollow);
							}
						})
			}
		});
		
		
		ownerInfo.hover(function(){
			clearTimeout(timer);
			$(this).show();
		},function(){
			$(this).hide();
		});
	},function(){
		timer=setTimeout(function(){
			ownerInfo.hide();
		},300);
	});
	
}
function regMyFollow() {
	var user = $(this);
	var params = {
		"query.followId" : user.parents(".stream-one").attr("userId")
	};
	followUser(params, function(ajaxResult) {
				if (ajaxResult.OK) {
					user.addClass("following").text("取消关注");
					user.unbind().click(regMyUnFollow);
				}
			})
}
function regMyUnFollow() {
	var user =  $(this);
	var params = {
			"query.followId" : user.parents(".stream-one").attr("userId")
	};
	unFollowUser(params, function(ajaxResult) {
				if (ajaxResult.OK) {
					user.removeClass("following").text("关注");
					user.unbind().click(regMyFollow);
				}
			})
}